package com.example.mentalhealth.Service;


import com.example.mentalhealth.entities.ExamRecordQuestion;
import com.example.mentalhealth.mapper.ExamRecordQuestionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

//记录做过的试题信息
@Service
public class ExamRecordQuestionService {

    @Autowired
    public ExamRecordQuestionMapper examRecordQuestionMapper;

    public List<ExamRecordQuestion> queryByExamRecordId(Long recordId){
        return examRecordQuestionMapper.queryByExamRecordId(recordId);
    };

    public int saveExamRecordQuestion(ExamRecordQuestion examRecordQuestion) {
        return examRecordQuestionMapper.insert(examRecordQuestion);
    }

    public List<ExamRecordQuestion> queryExamRecordQuestion() {
        return examRecordQuestionMapper.queryExamRecordQuestion();
    }

    public int updateScoreById(Long id, BigDecimal score,Integer isCorrect) {
        return examRecordQuestionMapper.updateScoreById(id, score,isCorrect);
    }
}
